The present invention is directed, in general, to processing systems and, more specifically, to a microprocessor having a floating point unit capable of handling tiny (denormal) results.
The demand for ever-faster computers requires that state-of-the-art microprocessors execute instructions in the minimum amount of time. Microprocessor speeds have been increased in a number of different ways, including increasing the speed of the clock that drives the processor, reducing the number of clock cycles required to perform a given instruction, implementing pipeline architectures, and increasing the efficiency at which internal operations are performed. This last approach usually involves reducing the number of steps required to perform an internal operation.
Efficiency is particularly important in the floating point unit of a microprocessor. In floating point representation, every number may be represented by a significand (or mantissa) field, a sign bit, and an exponent field. Although the size of these fields may vary, the IEEE-754 standard defines the most commonly used floating point notation and forms the basis for floating point units (FPUs) in x86 type processors. The IEEE-754 standard includes a signal precision format, a single extended precision format, a double precision format, and a double extended precision format. Single precision format comprises 32 bits: a sign bit, 8 exponent bits, and 23 significand bits. Single extended precision format comprises 44 bits: a sign bit, 11 exponent bits, and 32 significand bits. Double precision format comprises 64 bits: a sign bit, 11 exponent bits, and 52 significand bits. Double extended precision format comprises 80 bits: a sign bit, 15 exponent bits, and 64 significand bits.
It can be advantageous in a load-store implementation of IEEE-754 to represent all numeric values contained in the register file in the floating point unit as properly rounded values in a proprietary internal format with range and precision exceeding the widest supported IEEE-754 parameters. One such proprietary format is disclosed in U.S. patent application Ser. No. 09/377,140, entitled xe2x80x9cFormatting Denormal Numbers for Processing in a Pipelined Floating Point Unit,xe2x80x9d which is commonly assigned to the assignee of the present application. The disclosure of application Ser. No. 09/377,140 is hereby incorporated by reference into the present disclosure as if fully set forth herein. The internal proprietary format disclosed in U.S. patent application Ser. No. 09/377,140 comprises 93 bit: a sign bit, 17 exponent bits, and 70 significand bits, and a 5 bit tag field.
Complete implementations of the IEEE-754 floating-point standard must perform rounding and status generation for all possible results, including tiny (denormal) results. The base number for IEEE floating-point standards is understood to be binary. A xe2x80x9cnormalxe2x80x9d floating-point number is one which begins with the first non-zero digit in front of the binary xe2x80x9cdecimalxe2x80x9d point and a denormal number is one that begins with the first non-zero digit after the decimal point. The accuracy or precision of the number is determined by the number of digits after the decimal point.
Computers, including microprocessors, typically manipulate numbers in binary format. When operating in floating-point binary format, a microprocessor expects a normal floating-point binary number. As noted above, the normal floating-point binary number in the IEEE-754 format is understood to have a mantissa which begins with a 1, followed by the binary point, followed by subsequent 1""s and 0""s. Thus, the characterization of the mathematical result as tiny or denormal is a function of the exponent. Small denormal numbers which have been formatted to appear as normal numbers are often referred to as pseudo-denormal or pseudo-denormalized numbers.
In implementations where very small or tiny numbers are rarely expected, tiny results are frequently handled by microcode or software exceptions. On the other hand, highly pipelined implementations make no assumptions about the frequency of tiny numbers and tiny results are fully supported in both the addition and multiplication pipelines. The frequent processing of tiny numbers introduces delays in the associated pipelines and may even require additional stages and chip area to accommodate the tiny result processing requirements. In effect, all additions and multiplications are penalized by handling frequent tiny results.
Therefore, there is a need in the art for improved microprocessor architectures capable of handling tiny, denormal results more efficiently. In particular, there is a need for improved microprocessor architectures containing pipelined floating point units that are capable of handling denormal (tiny) results efficiently without requiring complex rounding units in each pipeline to handle the rounding of denormal numbers.
The limitations inherent in the prior art described above are overcome by the present invention which provides a denormal handling circuit for use in a pipelined floating point unit comprising at least one of an addition pipe and a multiplication pipe. In an advantageous embodiment of the present invention, the denormal result handling circuit comprises: 1) a denormal condition detection circuit associated with at least one of the addition pipe and the multiplication pipe capable of examining a first operand and a second operand loaded into the at least one of the addition pipe and the multiplication pipe and detecting a potential denormal condition, the potential denormal condition indicating that a calculated result generated from the first and second operands may be a denormal result, wherein the denormal condition detection circuit, in response to the detection of the potential denormal condition, prevents an additional operation from being loaded into the at least one of the addition pipe and the multiplication pipe; and 2) a complex rounding unit capable of receiving the calculated result from the at least one of the addition pipe and the multiplication pipe and, in response to the detection of the potential denormal condition, rounding the calculated result.
In one embodiment of the present invention, the denormal condition detection circuit is capable of disabling a simple rounding circuit associated with the at least one of the addition pipe and the multiplication pipe.
In another embodiment of the present invention, the denormal condition detection circuit detects the potential denormal condition if the first operand and the second operand are both normal.
In still another embodiment of the present invention, the denormal condition detection circuit detects the potential denormal condition if the first operand and the second operand are both denormal.
In yet another embodiment of the present invention, the denormal condition detection circuit detects the potential denormal condition if the first operand and the second operand are both pseudo-denormal.
In a further embodiment of the present invention, the pipelined floating point unit comprises an addition pipe and a multiplication pipe and the denormal result handling circuit comprises a first denormal condition detection circuit associated with the addition pipe and a second denormal condition detection circuit associated with the multiplication pipe.
In a still further embodiment of the present invention, the first denormal condition detection circuit is capable of disabling a first simple rounding circuit associated with the addition pipe.
In a yet further embodiment of the present invention, the second denormal condition detection circuit is capable of disabling a second simple rounding circuit associated with the multiplication pipe.
The foregoing has outlined rather broadly the features and technical advantages of the present invention so that those skilled in the art may better understand the detailed description of the invention that follows. Additional features and advantages of the invention will be described hereinafter that form the subject of the claims of the invention. Those skilled in the art should appreciate that they may readily use the conception and the specific embodiment disclosed as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. Those skilled in the art should also realize that such equivalent constructions do not depart from the spirit and scope of the invention in its broadest form.
Before undertaking the DETAILED DESCRIPTION OF THE INVENTION, it may be advantageous to set forth definitions of certain words and phrases used throughout this patent document: the terms xe2x80x9cincludexe2x80x9d and xe2x80x9ccomprise,xe2x80x9d as well as derivatives thereof, mean inclusion without limitation; the term xe2x80x9cor,xe2x80x9d is inclusive, meaning and/or; the phrases xe2x80x9cassociated withxe2x80x9d and xe2x80x9cassociated therewith,xe2x80x9d as well as derivatives thereof, may mean to include, be included within, interconnect with, contain, be contained within, connect to or with, couple to or with, be communicable with, cooperate with, interleave, juxtapose, be proximate to, be bound to or with, have, have a property of, or the like; and the term xe2x80x9ccontrollerxe2x80x9d means any device, system or part thereof that controls at least one operation, such a device may be implemented in hardware, firmware or software, or some combination of at least two of the same. It should be noted that the functionality associated with any particular controller may be centralized or distributed, whether locally or remotely. Definitions for certain words and phrases are provided throughout this patent document, those of ordinary skill in the art should understand that in many, if not most instances, such definitions apply to prior, as well as future uses of such defined words and phrases.